# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kpmcore
pkgver=4.1.0
pkgrel=3
arch="all !armhf"
url="https://kde.org/applications/system/org.kde.partitionmanager"
pkgdesc="Library for managing partitions"
license="GPL-3.0-or-later"
depends="sfdisk smartmontools device-mapper-udev"
makedepends="extra-cmake-modules qt5-qtbase-dev kauth-dev kcoreaddons-dev ki18n-dev kwidgetsaddons-dev qca-dev"
source="https://download.kde.org/stable/kpmcore/$pkgver/src/kpmcore-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Requires running dbus server

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="c45b31a41c62a68aee991be0f7954f4bd2136660578cc60f7fa6f05e56716458421e16cd314b3b9a14b56fdc9377db511c1645e5c41f0446d86a8ac5bb66c273  kpmcore-4.1.0.tar.xz"
